package com.rz.admin.controller;

import com.rz.admin.entity.AdminCollectMenu;
import com.rz.admin.service.IAdminCollectMenuService;
import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("adminMenu")
public class AdminMenuCtrl {

    @Resource private IAdminCollectMenuService adminCollectMenuService;

    @PostMapping("getCollectMenuByAdminId/{adminId}")
    public ResultResp getCollectMenuByAdminId(@PathVariable Integer adminId){
        return RespKit.success(adminCollectMenuService.getByAdminId(adminId));
    }

    @PostMapping("onSave")
    public ResultResp save(@RequestBody AdminCollectMenu adminCollectMenu){
        return RespKit.success(adminCollectMenuService.onSave(adminCollectMenu));
    }

}
